<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
    <style type="text/css">
        * {
            margin: 0%;
            padding: 0%;
        }

        #content {
            width: 10px;
            height: 10px;
        }
    </style>
    <script src="./swap.js"></script>
</head>

<body>
    <div id='content'>
    </div>
    <!-- <div class="button">
        <button>点击</button>
    </div> -->
    <script>
        $(function () {
            let target = new Swap({
                target: "#content",
                items: [
                    {
                        background: "black",
                    }, {
                        background: "red",
                    }, {
                        background: "yellow",
                    }
                ]
            });
            target.scroll(1000);
            // $("button").click(function () {
            //     target.scrollTo('left', 2, 5000);
            // });
        })
    </script>
</body>

</html>